<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@ page import="javax.portlet.*"%>
<%@page import="com.liferay.portal.model.User" %>
<%@page import="com.liferay.portal.util.PortalUtil" %>
<%@page import="com.jefe.bamboo.service.service.*" %>
<%@page import="com.jefe.bamboo.service.model.*" %>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%--
Author: Sonali Mendis
Code:   Bamboo Portlet for Jefe (http://www.jefesolutions.com)
License:GNU
--%>
<portlet:defineObjects />
<%
    long id = 0;
    User currentUser = null;
    try {
        currentUser = PortalUtil.getUser(request);
        id = currentUser.getUserId();
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    String host = null;
    int port = 0;
    Boolean userSet = false;
    try{
        UserPrefsBmb userDtls = UserPrefsBmbLocalServiceUtil.getUserPrefsBmb(id);
        host = userDtls.getBmbHost();
        port = userDtls.getBmbPort();
        userSet = true;
    }catch(Exception ex){
        System.out.println(ex.getMessage());
    }
%>
<div style="text-align: justify">
<strong>Bamboo Portlet Guide:</strong>
<ul type="1">
    <li>
        Bamboo is a popular, proprietary Continuous Integration server. Bamboo server setup can be downloaded from the <a href="http://www.atlassian.com/software/bamboo/BambooDownloadCenter.jspa" target="_blank">Bamboo Official Site</a>.
    </li>
    <li>
        A guide to configure the Bamboo CI server and use it for continuous integration can be found <a href="http://confluence.atlassian.com/display/BAMBOO/Bamboo+Standalone+Installation+Guide+(Windows)" target="_blank">here</a>.
    </li>
    <li>
        The objective of this Bamboo Portlet is to allow users to connect to Bamboo server and view their builds through Jefe.
    </li>
    <li>
        Please see the <b>Bamboo</b> section of the Jefe Manual for more details.
    </li>
</ul>
</div>
<% if(userSet){%>
<hr style="border-bottom: dotted 1px"/>
<div class="portlet-section-footer" >
    More on: <a href="http://<%=host %>:<%=port %>" >Bamboo</a>
</div>
<% } %>